module.exports = function (sequelize, DataTypes) {
    const Role = sequelize.define('Role', {
        jobTitle: {
            type: DataTypes.STRING,
            allowNull: false,
            comment: '职位名称'
        },
        createdByUserId: {
            type: DataTypes.STRING,
            allowNull: false,
            comment: '创建人Id'
        }
    }, {
        timestamps: true, //createAt updateAt是否显示
        createdAt: "createdTime", // 将createdAt设为自定义字段createdTime
        updatedAt: "updatedTime",
        deletedAt: "deletedTime",
        paranoid: true,
    })

    return Role;
}
// Role.sync({force: true});
// Role.sync({alter: true});
// Role.belongsToMany(Menu, {through: RolePermission}); // A 属于多个 B , 通过联结表 C
// Role.hasMany(RolePermission,{
//     foreignKey: 'roleId'
// })
// RolePermission.belongsTo(Role,{
//     foreignKey: 'id'
// })

// module.exports = Role;
